<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>LifeCycle</title>
    </head>
    <body>
        <div id="app">
          <div v-value="msg" id="parent">{{msg}}<div id="child">{{msg}}</div></div>
        </div>
        <script src="my-vue.js"></script>
        <script>  
        Vue.directive('value',{
           update(el,binding){
            console.log('update',document.getElementById('child').innerText)
           },
           componentUpdated(el,binding){
            console.log('componentUpdated',document.getElementById('child').innerText)
           },
           unbind(){
            console.log('unbind')
           }
        });
        var vm = new Vue({
            el:'#app',
            data:{
                msg:'hello'
            },
        });
    </script>
    </body>
</html>